﻿using System;

using ProtoBuf;


namespace PnJ.Aliyun.OTS.Models
{
    /// <summary>
    /// 表示一列的列值
    /// </summary>
    [ProtoContract(Name = "ColumnValue")]
    public class ColumnValue
    {
        /// <summary>
        /// 该列的数据类型
        /// </summary>
        [ProtoMember(1, Name = "type", IsRequired = true)]
        public ColumnType Type { get; set; }
        /// <summary>
        /// 该列的数据，只在type为INTEGER时有效
        /// </summary>
        [ProtoMember(2, Name = "v_int")]
        public Int64 VInt { get; set; }
        /// <summary>
        /// 该列的数据，只在type为STRING时有效，必须为UTF-8编码
        /// </summary>
        [ProtoMember(3, Name = "v_string")]      
        public string VString { get; set; }
        /// <summary>
        /// 该列的数据，只在type为BOOLEAN时有效
        /// </summary>
        [ProtoMember(4, Name = "v_bool")]
        public bool VBool { get; set; }
        /// <summary>
        /// 该列的数据，只在type为DOUBLE时有效
        /// </summary>
        [ProtoMember(5, Name = "v_double")]
        public double VDouble { get; set; }
        /// <summary>
        ///  该列的数据，只在type为BINARY时有效
        /// </summary>
        [ProtoMember(6, Name = "v_binary")]
        public byte[] VBinary { get; set; }  
    }
}
